package com.seeyon.apps.demo.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.seeyon.apps.demo.manager.DemoManager;
import com.seeyon.ctp.common.controller.BaseController;
import com.seeyon.ctp.util.annotation.Inject;

/**
 * MVC Controller extends ctp->BaseController
 */
public class DemoController extends BaseController{
	@Inject
	private DemoManager demoManager;
	
	/**
	 * index方法是：URL不传任何method，默认访问的方法
	 */
	@Override
	public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
		return new ModelAndView("apps/demo/index");
	}
	
	public ModelAndView toAdd(HttpServletRequest request, HttpServletResponse response) throws Exception {
		// 建议Controller方法名与JSP名一致，以保障知道URL后快速反查对应方法
		ModelAndView mav =  new ModelAndView("apps/demo/toAdd");
		return mav;
	}
	
	
}
